package com.easychat.entity.enums;

public enum UserStatusEnum {
    DISABLE(0, "禁用"),
    ENABLE(1, "启用");

    //状态，0禁用，1启用
    private Integer status;
    //描述
    private String description;

    UserStatusEnum(Integer status, String description) {
        this.status = status;
        this.description = description;
    }

    public Integer getStatus() {
        return status;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据状态返回对应的枚举对象
     * @param status
     * @return
     */
    public static UserStatusEnum getByStatus(Integer status) {
        for (UserStatusEnum statusEnum : UserStatusEnum.values()) {
            if (status.equals(statusEnum.getStatus())) {
                return statusEnum;
            }
        }
        return null;
    }
}
